<?php
error_reporting(0);

header("Content-type: image/png");
$im = @imagecreate(50, 23)  or die("Cannot Initialize new GD image stream");

$background_color = imagecolorallocate($im, 150, 150, 150);
$gray_dark = imagecolorallocate ($im,0x7f,0x7f,0x7f);
$text_color = imagecolorallocate($im, 255, 128, 0);

imagefilledrectangle($im,0,0,51,24,$gray_dark);
imagefilledrectangle($im,1,1,50,23,$background_color);


$page = urldecode($_REQUEST['page']);
require_once("pageRank.php");
//echo $page."<br>";
if (empty($page)) {

	$gpr = new pageRank();

	$gpr->printrank($page);

	$pr = $gpr->get_rank();

} else {
	$pr = 'na';
}


imagestring($im, 5, 5, 3,  intval($pr).'/10', $text_color);
imagepng($im);
imagedestroy($im);
?>